package com.example.fsd.controller.configs;

import com.example.fsd.common.result.R;
import com.example.fsd.pojo.Configs;
import com.example.fsd.service.comments.ICommentsService;
import com.example.fsd.service.configs.IConfigsService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhangguihong
 * @since 2024-11-20
 */
@RestController
@RequestMapping("/configs")
@RequiredArgsConstructor
public class ConfigsController {
    private  final IConfigsService configsService;

    @GetMapping("/findOneConfigs")
    private R findOneConfigs(){
        return configsService.findOneConfigs();
    }

    @PostMapping("/updateConfigsLogo")
    private R updateConfigsLogo(MultipartFile logo){
        return configsService.updateConfigsLogo(logo);
    }

    @PostMapping("/updateConfigs")
    private R updateConfigs(@RequestBody Configs configs){
        return configsService.updateConfigsText(configs);
    }
}
